package com.cabinet.service.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import com.cabinet.web.entity.User;



public interface UserDao extends JpaRepository<User, Long>,JpaSpecificationExecutor<User> {
	
	@Query("select u from User u where u.uAccount = ?1 and u.uPwd = ?2")
	public User getUserByUserAccountAndUserPassword(String uAccount,String uPwd);

	@Query("select u from User u where u.uAccount = ?1")
	public User getUserByUserAccount(String uAccount);
	
	@Query("select u from User u where u.openId = ?1")
	public User getUserByOpenid(String openId);
}
